package com.kis.service

import com.kis.dao.UserDao
import com.kis.model.user.User
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Component
import org.springframework.util.StringUtils

/**
 * Created by wongloong on 16-12-5.
 */
@Component("userService")
class UserService : BaseService<User, Int> {
    @Autowired
    lateinit private var userDao: UserDao

    override fun add(t: User): Boolean {
        return userDao.save(t) != null
    }

    override fun select(id: Int): User {
        return userDao.findOne(id)
    }

    override fun saveOrUpdate(t: User): Boolean {
        return userDao.save(t) != null
    }

    override fun queryAll(t: User): List<User> {
        throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
    }
}
